Skip to content

fix: add missing device types, fix Hub Mini alias, fix credential cache - #71

Merged
chenliuyun merged 6 commits into
mainfrom
fix/hub-mini-matter-alias
Jul 28, 2026
Merged

fix: add missing device types, fix Hub Mini alias, fix credential cache#71
chenliuyun merged 6 commits into
mainfrom
fix/hub-mini-matter-alias

Conversation

@chenliuyun

Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • npx vitest run — 2392/2392 passing
  • npm run typecheck — clean
  • New entries verified against upstream OpenWonderLabs/SwitchBotAPI docs

chenliuyun added 6 commits July 27, 2026 20:44
…est list (#70)

Renames the 'Hub Mini2' alias to the official marketing name 'Hub Mini
Matter Enabled', and registers the 9 new catalog entries from the prior
commit in OFFICIAL_API_DEVICE_TYPES.
- Smart Lock Pro Wifi: add missing nightLatchUnlock, deadbolt commands
- Lock Vision / Lock Vision Pro: add missing createKey command
- WeatherStation: alias 'Weather Station' display name
- Battery Circulator Fan 2 Pro, AI MindClip: drop undocumented statusFields
- RGBICWW Ceiling Light: add exampleParams to setColorLightRGB
- Backfill OFFICIAL_SUPPORTED_DEVICE_LIST_NAMES with the 9 new device names
- Add regression test for #69 (saveConfig clears stale primed credentials)
Resolve device-catalog conflicts with PR #47 (Weather Station, Lock
Vision, Lock Vision Pro, Smart Lock Pro Wifi) by verifying against
upstream SwitchBotAPI docs — PR #47's data was factually wrong in
several places (fabricated atmosphericPressure field, missing
createKey/deleteKey commands, Smart Lock Pro Wifi wrongly aliased
instead of its own Matter entry). Re-wire saveConfig() to main's
newer multi-profile clearPrimedCredentials() API to keep the #69 fix.
- Add missing exampleParams for WeatherStation/Kata Friends so
  suggestedActions() emits runnable commands
- Add onlineStatus to Permanent Outdoor Lights / RGBICWW Ceiling Light
  statusFields
- Wire Permanent Outdoor Lights into brightness/color/color-temp validation
- Add dedicated validation for Battery Circulator Fan 2 Pro enums
- Reuse Keypad passcode validation for Lock Vision / Lock Vision Pro
- Fix stale comment on __resetPrimedCredentials
@chenliuyun

Copy link
Copy Markdown
Collaborator Author

Addressed the second review pass in a68970d:

  1. suggestedActions() produced unexecutable suggestions — WeatherStation (customQuote/customPage) and Kata Friends (mode/childLock/pictureTaking/snapshots/talk) commands had no exampleParams, so downstream validateCommand() rejected them with missing-parameter. Added exampleParams to all of them.
  2. Permanent Outdoor Lights and RGBICWW Ceiling Light were missing onlineStatus in statusFields (confirmed against the official device docs). Added.
  3. New device types weren't wired into client-side parameter validation:
    • Permanent Outdoor Lights added to brightnessRange/isColorDevice/isColorTemperatureDevice.
    • Battery Circulator Fan 2 Pro given its own validation branch — its setWindMode/setNightLightMode enums differ from the older Circulator Fan models, so it isn't merged into isCirculatorFan().
    • Lock Vision/Lock Vision Pro createKey/deleteKey now reuse the Keypad passcode JSON validation (same shape, previously unvalidated).
  4. Fixed a stale comment on __resetPrimedCredentials() that described clearPrimedCredentials()'s behavior instead of its own.

Added unit tests in tests/devices/param-validator.test.ts for all the validation changes above. Full suite: 3018 passed.

@chenliuyun
chenliuyun merged commit 553565b into main Jul 28, 2026
19 checks passed
@chenliuyun
chenliuyun deleted the fix/hub-mini-matter-alias branch July 28, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant